{% load custom %}
<!DOCTYPE html>


<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>草榴社区</title>

    <!-- Bootstrap core CSS -->
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="/static/bootstrap/css/navbar-fixed-top.css" rel="stylesheet">
    <link href="/static/bootstrap/css/custom.css" rel="stylesheet">
    {% block plug-js %} {% endblock %}
  </head>

  <body>

    <!-- Fixed navbar -->
    <nav class="navbar navbar-default navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <a class="navbar-brand" href="{% url 'index' %}">草榴社区</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <!-- 顶部动态菜单  -->
            <ul class="nav navbar-nav">
              {% for category in category_list %}
                {% if category.id == category_obj.id %}
                    <li class="active"><a href="{% url 'article' category.id %}">{{ category.name }}</a></li>
                {% else %}
                    <li class=""><a href="{% url 'article'  category.id %}">{{ category.name }}</a></li>
                {% endif %}
              {% endfor%}
            </ul>

          <ul class="nav navbar-nav navbar-right">
            {% if request.user.is_authenticated %}
                <li  style="padding-top: 10px;">
                <span ><img src="/static/{{ request.user.userprofile.head_img|truncate_url }}" width="25" height="25"></span>
                </li>
                <li class="">
                    <a href="#">{{ request.user.userprofile.name }}</a>
                </li>
                <li class=""><a href="{% url 'logout' %}">注销</a></li>
                <li class=""><a href="{% url 'pub_article' %}">投稿</a></li>
            {% else %}
                <li class=""><a href="{% url 'login' %}">登录/注册</a></li>
            {% endif  %}
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>

    <div class="page-container">
    <!--  主页面的内容   -->
        {% block page-container %}
          <!-- Main component for a primary marketing message or call to action -->
          <div class="jumbotron">
            <h2>your own stuff</h2>
          </div>
        {% endblock %}

    </div> <!-- /container -->

    <!-- 底部开始  -->
    <footer class="footer">
        <div class="foot-div"><span style="color:#b2bae1">底部广告栏</span></div>
    </footer>

    <!-- 底部结束 -->
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="/static/bootstrap/js/jquery-2.1.4.js"></script>
    <script src="/static/bootstrap/js/bootstrap.min.js"></script>

    {% block self-js %}{% endblock %}
</body></html>